#ifndef INC_MULTIRESULTCOMMAND_H
#define INC_MULTIRESULTCOMMAND_H

#include "command.h"

#include <vector>
#include <utility>
using namespace std;

#include <Poco/Net/SocketAddress.h>
using Poco::Net::SocketAddress;

namespace Commands {

	/**
	 * Class to handle multiple received results
	 */
	class MultiResultCommand : public Command
	{
		public:
			typedef pair<SocketAddress, string> OrigRepr;
			/**
			 * @param s Socket on which this command was received.
			 */
			MultiResultCommand(SocketAddress* s = 0, bool needs_result = true);

			virtual ~MultiResultCommand() {}
			
			/**
			 * Returns the first received result.
			 */
			string result();
			
			virtual void setResult(string res, SocketAddress const addr = SocketAddress());

		protected:
			/**
			 * The collected results.
			 */
			vector<OrigRepr> results();

		private:
			vector<OrigRepr> _results;
	};

}
#endif
